<?php

namespace app\admin\controller;

use think\Controller;
use data\service\ConfigService;
use data\model\Config as ConfigModel;

class Config extends BaseController
{

    private $service;

    // 模型初始化
    public function initialize()
    {
        parent::initialize();
        $this->service = new ConfigService();
    }

  /**
   * 用户信息配置
   */
  public function userConfig(){
      $data = $this->service->getConfigByType(ConfigModel::USER_CONFIG);
      $this->assign('config',$data);
      return $this->fetch();
  }

  /**
   * 博客信息配置
   */
  public function webConfig(){
      $data = $this->service->getConfigByType(ConfigModel::WEB_CONFIG);
      $this->assign('config',$data);
      return $this->fetch();
  }

}
